import { rejects } from 'assert';
import Koa from 'koa';
import Router from "koa-router";
import { resolve } from 'path';

const router = new Router();

router.all('/',function(ctx:Koa.Context){
    ctx.body="USER";
});
router.all('/index', async function(ctx:Koa.Context){
    ctx.body = await getData()
    // ctx.body="USER index";
});

async function getData(){
   return new Promise((resolve,reject)=>{
    setTimeout(() => {
        resolve("成功")
    }, 500);
   });
}

export default router;
